package com.zzld.modules.sys.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.abel533.mapper.Mapper;
import com.zzld.core.service.BaseServiceImpl;
import com.zzld.modules.common.dto.TreeGrid;
import com.zzld.modules.sys.entity.Dict;
import com.zzld.modules.sys.service.IDictService;

@Service("dictService")
public class DictServiceImpl extends BaseServiceImpl<Dict> implements IDictService {

	@Autowired
    private Mapper<Dict> dictMapper;
	
	/**
	 * 获取全部数据
	 * @return
	 */
	public List<Dict> getAll(){
		return dictMapper.select(null);
	}
	
	
	/**
	 * 获取树形网格
	 * @return
	 */
	public List<TreeGrid> treeGrid(){
		List<TreeGrid> treeGrids = new ArrayList<TreeGrid>();
		/*List<Dict> listDict=dictMapper.treeGrid();
		if(listDict !=null && listDict.size()>0){
			for (Dict Dict : listDict) {
				TreeGrid treeGrid=new TreeGrid();
				BeanUtils.copyProperties(Dict, treeGrid);
				treeGrid.setText(Dict.getName());
				treeGrids.add(treeGrid);
			}
		}*/
		return treeGrids;
	}
}
